//
//  XYHUD.m
//  dielianw
//
//  Created by XY Lv on 17/2/15.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "XYHUD.h"

@implementation XYHUD
+ (void)xy_showHudWithTitle:(NSString *)title withDelay:(NSTimeInterval)delay{
    MBProgressHUD * hud = [[MBProgressHUD alloc]initWithView:[UIApplication sharedApplication].keyWindow];;
    hud.labelText = title;
    hud.mode = MBProgressHUDModeText;
    [[UIApplication sharedApplication].keyWindow addSubview:hud];
    [hud show:YES];
    [hud hide:YES afterDelay:delay];
}

- (UIAlertController *)xy_showAlertViewWithTitle:(NSString *)title withMessage:(NSString *)message{
    
    UIAlertController * alertController = [UIAlertController alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerStyleAlert];
    UIAlertAction * okAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        self.xyReturnOkBtnClick();
        
    }];
    
    UIAlertAction * cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
        
    }];
    [alertController addAction:cancelAction];
    [alertController addAction:okAction];
    
    return alertController;
    
}

@end

















